package com.gx.project.domain;

import com.gx.project.base.dao.BaseDao;
import com.gx.project.base.domain.AbstractBaseDomain;
import com.gx.project.po.User;
import com.gx.project.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author gx
 * @description
 */
@Service("userDomain")
public class UserDomainImpl extends AbstractBaseDomain<User,Long> implements UserDomain {

    @Autowired
    private UserDao userDao;


    @Override
    protected BaseDao<User, Long> getBaseDao() {
        return userDao;
    }

    @Transactional
    public void addUser(String name) {
        User dto = new User();
        dto.setName(name);
        userDao.insert(dto);
    }
}
